
package com.zhku.laosiji.service.Impl;

import com.zhku.laosiji.dao.ParkMapper;
import com.zhku.laosiji.pojo.Park;
import com.zhku.laosiji.service.ParkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Jiayuan
 * @version 1.0
 * @description:
 * @time 9/11/2018 9:08 AM
 */
@Service
public class ParkServiceImpl implements ParkService {
    @Autowired
    private ParkMapper parkMapper;

    @Override
    public List<Park> find(Integer status) {
        List<Park> parks = parkMapper.find(status);
        return parks;
    }

    @Override
    public Park findDetail(Integer id) {
        Park park = parkMapper.selectByPrimaryKey(id);
        return park;
    }

    @Override
    public int updateStatus(Integer parkId,Integer status) {
        int i = parkMapper.updateStatus(parkId,status);
        return i;
    }

	@Override
	public List<Park> selectAllPark() {
		List<Park> selectAllPark = parkMapper.selectAllPark();
		return selectAllPark;
	}

	@Override
	public Integer countTotalPark() {
		return parkMapper.countTotalPark();
	}

	@Override
	public int insertSelective(Park record) {
		parkMapper.insertSelective(record);
		return 0;
	}

	@Override
	public Park selectByPrimaryKey(Integer id) {
		Park park = parkMapper.selectByPrimaryKey(id);
		return park;
	}

	@Override
	public int updateByPrimaryKey(Park record) {
		parkMapper.updateByPrimaryKey(record);
		return 0;
	}

	@Override
	public int deleteByPrimaryKey(Integer id) {
		parkMapper.deleteByPrimaryKey(id);
		return 0;
	}

	@Override
	public List<Park> selectParkByName(String parkname) {
		return parkMapper.selectParkByName(parkname);
	}

	@Override
	public Integer countSearchPark(String parkname) {
		return parkMapper.countSearchPark(parkname);
	}
	
	
}